import HTTP from "../util/http"
export class LikeModel extends HTTP{
    like(behavior, artID, category) {
        let url = behavior === 'like' ? 'like' : 'like/cancel';
        return new Promise((resolve, reject) => {
            this.request({
                url,
                method: 'POST',
                data: {
                    art_id: artID,
                    type: category
                },
                success: (res = []) => {
                    resolve(res);
                }
            })
        })
    }
    getClassicLikeStatus(artID, category) {
        return new Promise((resolve, reject)=>{
            this.request({
                url: `classic/${category}/${artID}/favor`,
                success(res) {
                    resolve(res);
                },
                fail(error) {
                    reject(error);
                }
            })
        })
    }
}